// ActionList.h: interface for the CActionList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ACTIONLIST_H__E283FFB3_5789_4AB3_8837_538D70C36AEE__INCLUDED_)
#define AFX_ACTIONLIST_H__E283FFB3_5789_4AB3_8837_538D70C36AEE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Common.h"

class CActionNode
{
public:
	CActionNode* pPreNode;
	CActionNode* pNextNode;

	CBaseAction* pAct;
	BOOL bProcessed;

	CActionNode() {
		pPreNode = NULL;
		pNextNode = NULL;
		pAct = NULL;

		bProcessed = FALSE;
	}

	~CActionNode() 
	{ 
		if(pAct) { delete pAct; pAct = NULL; }
	}
};

class CActionList  
{
public:
	CActionNode* pFirst;
	CActionNode* pLast;
	int TotNum;

	CActionList();
	virtual ~CActionList();
	void Clear();

	BOOL IsActionProcessed();

	BOOL AddAction(CBaseAction& act);
	BOOL EnqueAction(CBaseAction* pAct);
	BOOL DequeAction();
	CBaseAction* PeekAction();
	BOOL DelAction(CBaseAction* pAct);
	CActionNode* FindAction(CBaseAction* pAct);
};

#endif // !defined(AFX_ACTIONLIST_H__E283FFB3_5789_4AB3_8837_538D70C36AEE__INCLUDED_)
